﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="topbar.aspx.cs" Inherits="Joyintech.Admin.inpiao365.general.topbar" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%=cssStyle %>    
    <script type="text/javascript" src="/theme/main-menu.js"></script>
    <script src="../module/lhgdialog/lhgcore.min.js" type="text/javascript"></script>
    <script src="../module/lhgdialog/lhgdialog.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        J(function(){ 
                 var strhtml = "<table width=100% border=0><tr>";

		         <% if(dtbTheme.Rows.Count > 0) {
		         for(int i=0;i<dtbTheme.Rows.Count;i++)
		         {
		          %>
                  strhtml += "<td>";
		          strhtml += "<a href='index.aspx?theme=<%=i+1%>' target=_parent>";
                  strhtml += "<img src='/theme/pic/<%=i+1%>.gif' width='48' border=0 align='absmiddle' /><br>";
                  strhtml += '<%=dtbTheme.Rows[i]["Name"].ToString() %>';
                  strhtml += "</a></td>";
		         <%
		         } } %>	 
        		
                strhtml += "</tr></table>";

            J('#btn1').dialog({ id:'test1',title:'更改主题', width:540, height:120, maxBtn:false,cover:true,lockScroll:true ,btnBar:false, html:strhtml }); 
        });

        var theme='<%=theme%>';


        function loginout()
        {
            msg="您好，<%=userName %>，您确认要退出系统吗？";
            if(window.confirm(msg))
            {
                parent.location="../login.aspx?logout=0";
            }
        }

        function makeClickEvent(action) {
	        if (typeof(action) == 'function') {
		        action(event);
	        } else {
		        eval(action);
	        }
        }

        window.onload = function() {
	        MainMenu.init('/theme/<%=theme%>/menu/');
	        MainMenu.clickMainItemByDefault('menu<% =menuId %>');
             
            var ishide=<%=ishide %>;

            if(ishide=="1")
            {
                leftmenu_ctrl();
            }
        }

        function modifyUser(){
	        var top = (screen.availHeight - 650) / 2;
	        var left = (screen.availWidth - 900) / 2;
	        window.open('/general/person_info/index.aspx', 'newwindow', 'height=600, width=720, top='+top+', left='+left+', toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no');
        }

        window.onerror = function(e){return true;};

        function navMenu()
        {
            parent.leftmenu.location='menu.aspx?menu_id=' + document.getElementById("menu_default").value;	
        }

        function setMenu(menuId)
        {
            leftmenu_open();
	        document.getElementById("menu_default").value = menuId;
        }
        
        //设置左侧二级菜单状态
        function setMenu(menuId,state,menuurl)
        {
            leftmenu_close();

            if(state=='True')
            {
                leftmenu_open();
            }
            if(menuurl!="")
            {
                parent.main.location = menuurl;
            }
	        document.getElementById("menu_default").value = menuId;
        }

        var menuview=0;

        function leftmenu_open()
        {
            parent.document.getElementById("frame2").cols="182,*";
	        menuview=0;
	        document.getElementById("myarrow").innerText="<";	
	        document.getElementById("naviMenu2").style.display="";
        }

        function leftmenu_close()
        {
              parent.document.getElementById("frame2").cols="0,*";		
              menuview=1;
              document.getElementById("myarrow").innerText=">";
              document.getElementById("naviMenu2").style.display='none';
        }

        function leftmenu_ctrl()
        {
           if(menuview==0)
           {
	          parent.document.getElementById("frame2").cols="0,*";		
              menuview=1;
              document.getElementById("myarrow").innerText=">";
              document.getElementById("naviMenu2").style.display='none';
           }
           else
           {
	        parent.document.getElementById("frame2").cols="182,*";
	        menuview=0;
	        document.getElementById("myarrow").innerText="<";
	        document.getElementById("naviMenu2").style.display='';
           }
        }

        function SlyarErrors() { 
	        return true;
        } 
        window.onerror = SlyarErrors;

        function topHeader_ctrl()
        {
           if(document.getElementById("topHeader").style.display == "none")
           {
                document.getElementById("topHeader").style.display = "";
                document.getElementById("headerCtl").src = "../theme/basic_search.gif";
	            parent.document.getElementById("frame1").rows="124,*";
           }
           else
           {
                document.getElementById("topHeader").style.display = "none";
                document.getElementById("headerCtl").src = "../theme/advanced_search.gif";
	            parent.document.getElementById("frame1").rows="30,*";
           }
        }

        function show_about()
        {
            var url="about.aspx";
            var mwidth = "510";
            var mheight = "230";			
            var loc_x=parseInt((window.screen.width - mwidth)/2);
            var loc_y=parseInt((window.screen.height - mheight)/2); 
            if(window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
	            window.open(url,"about","left=" + loc_x + "px,top=" + loc_y + "px,width=" + mwidth + "px,height=" + mheight + "px,resizable=no,scrollbars=yes,status=0");
            else
	            window.showModalDialog(url,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");			
        }

    </script>
</head>
<body style="margin: 0px;" oncontextmenu="" ondragstart="return false" onselectstart="return false"
    onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false">
    <form id="form1" runat="server">
    
    <div id="topHeader" style="display: ;">
    <asp:HiddenField ID="menu_default" runat="server" Value="01" Visible="True" />    
        <table border="0" cellpadding="0" cellspacing="0" background="/theme/<%=theme%>/menu/head_topline_bg.gif"
            id="toplinebg">
            <tr>
                <asp:Literal ID="litLogoImg" runat="server"></asp:Literal><td id="headline" background="/theme/<%=theme%>/menu/head_topline.gif">
                    <div id="companymanecn">
                        <font color="#ffffff">
                            <asp:Literal ID="litBannerText" runat="server"></asp:Literal></font></div>
                    <div id="topuser">
                        <a id="btn1" title="切换界面主题风格" style="cursor:hand;">
                                <img src="/theme/readme.gif" width="14" height="16" border="0" align="absmiddle" />&nbsp;<font color=white>换主题</font></a>&nbsp;
                            <a href="/general/changePassword.aspx" title="修改密码" target="main">
                            <img src="/theme/sys_config.gif" width="14" alt="修改密码" height="16" border="0" align="absmiddle" />&nbsp;修改密码</a>&nbsp;
                        <img src="/theme/1.gif" border="0" align="absmiddle" />&nbsp;<%=userName%>
                        |&nbsp;&nbsp;<a href="javascript:loginout();" title="退出系统"><img src="/theme/icon_shezhi.gif"
                            align="absmiddle" border="0">&nbsp;退出</a>&nbsp;&nbsp;
                    </div>
                </td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" background="/theme/<%=theme%>/menu/head_topbg.gif"
            style="padding-top: 0px;">
            <tr>
                <td class="menu">
                    <table border="0" cellpadding="0" cellspacing="0" style="margin-top: 2px;">
                        <tr>
                            <td>
                                <img src="/theme/<%=theme%>/menu/head_button_tiao.gif" /></td>
                            <td nowrap id="menu0" menulevel="0" songroupid="menugroup0" onmouseover="MainMenu.onMouseOver(this)"
                                onmouseout="MainMenu.onMouseOut(this)" onclick="MainMenu.onClick(this);setMenu('0','false','/general/mytable/index.aspx');"
                                background="/theme/<%=theme%>/menu/menuitem0_default_bk_right.gif" class="menuitem0_default"
                                style="cursor: hand" title="首页">
                                <img src="/theme/<%=theme%>/menu/menuitem0_default_bk_left.gif" align="absmiddle"
                                    class="menu_leftimg" />首&nbsp;&nbsp;页
                            </td>
                            <td nowrap>
                                <img src="/theme/<%=theme%>/menu/head_button_tiao.gif" />
                            </td>
                            <%
                                if (dtbMenu.Rows.Count > 0)
                                {
                                    int Num = 0;
                                    for (int i = 0; i < dtbMenu.Rows.Count; i++)
                                    {
                                        if (arr.IndexOf(dtbMenu.Rows[i]["MenuId"].ToString()) >= 0)
                                        {
                                            if (Num == 0)
                                            {
                                                this.menu_default.Value = dtbMenu.Rows[i]["MenuId"].ToString();
                                                menuId = dtbMenu.Rows[i]["MenuId"].ToString();
                                            }
                                            Num++;
                            %>
                            <td nowrap id="menu<%=dtbMenu.Rows[i]["MenuId"].ToString()%>" menulevel="0" songroupid="menugroup<%=dtbMenu.Rows[i]["MenuId"].ToString()%>"
                                onmouseover="MainMenu.onMouseOver(this)" onmouseout="MainMenu.onMouseOut(this)"
                                onclick="MainMenu.onClick(this);setMenu('<%=dtbMenu.Rows[i]["MenuId"].ToString()%>','True','');parent.leftmenu.location='menu.aspx?menu_id=<%=dtbMenu.Rows[i]["MenuId"].ToString()%>'"
                                background="/theme/<%=theme%>/menu/menuitem0_default_bk_right.gif" class="menuitem0_default"
                                style="cursor: hand" title="<%=dtbMenu.Rows[i]["MenuName"].ToString()%>">
                                <img src="/theme/<%=theme%>/menu/menuitem0_default_bk_left.gif" align="absmiddle"
                                    class="menu_leftimg" /><%=dtbMenu.Rows[i]["MenuName"].ToString()%>
                            </td>
                            <td nowrap>
                                <img src="/theme/<%=theme%>/menu/head_button_tiao.gif" /></td>
                            <%
                                        }
                                    }
                                }
                            %>
                        </tr>
                    </table>
                </td>
                <td id="logo">
                    <iframe src="http://m.weather.com.cn/m/pn4/weather.htm " width="160" height="20"
                        marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" allowtransparency="true"
                        scrolling="no"></iframe>
                </td>
            </tr>
        </table>
        </div>
        <span id="menugroup0" style="display: " defaultmenuid="menu11">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" background="/theme/<%=theme%>/menu/head_top2bg.gif"
                style="margin-top: -2px">
                <tbody>
                    <tr>
                        <td class="menu2" valign="top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr height="25">
                                    <td id="naviMenu2">
                                        
                                    </td>
                                    <td width="30" class="online" title="显示/隐藏左侧面板" onclick="leftmenu_ctrl();" style="cursor: pointer;
                                        cursor: hand;" align="center">
                                        <span id="myarrow"><</span></td>
                                    <td width="200" class="online" id="menu14">
                                        
                                    </td>                                    
                                    <td class="online" width="*">
                                        <!--消息提示列表 开始-->
                                        &nbsp;&nbsp;&nbsp;&nbsp;<marquee onmouseover="this.stop();" onmouseout="this.start();"
                                            scrollamount="2" scrolldelay="50" director="left" width="90%">欢迎使用本系统……</marquee>
                                        <!--消息提示列表 结束-->
                                    </td>
                                    <td class="online" align="right" valign="middle" width="85">
                                       <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td valign="middle">
                                                <img src="../theme/basic_search.gif" id="headerCtl" alt="显示/隐藏一级菜单" title="显示/隐藏一级菜单"
                                                    onclick="topHeader_ctrl();" />
                                            </td>
                                            <td class="about" align="right" valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:show_about();" ><span class="about">关于</a>&nbsp;&nbsp;</td>
                                        </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </span>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
    var menuName = "menu" + document.getElementById("menu_default").value;
    //alert(menuName);
    //document.getElementById(menuName).click();
    //setMenu(menuName);
    setMenu(menuName, "", "../general/mytable/index.aspx");
</script>
<!--[if lte IE 6]>
<script type="text/javascript" src="/module/PNG.js"></script>
<![endif]-->
